home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / espool.com / SPLTEST.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-12-21  |  2.4 KB  |  88 lines

  1. Program Spooler_Test;
  2.  
  3. uses CRT,ESpooler;
  4.  
  5.  
  6. VAR
  7.   Ch : Char;
  8.   X,Result : integer;
  9.   splstat : SplStatType;
  10.  
  11.  
  12. BEGIN
  13.   DirectVideo := FALSE;
  14.   FOR X := 1 to 10 DO   { Write out ten lines of text to main memory spooler. }
  15.     BEGIN
  16.       Writeln(SPL,'Hello, Hello, is there anybody out there ? ',X,' ',Memavail);
  17.       Writeln(X);
  18.     END;
  19.   Spoolerstatus(splstat);
  20.  
  21.   While splstat.BytesToPrint <> 0 DO          { Wait while spooler empties }
  22.     BEGIN                                     {  before going on.          }
  23.       Spoolerstatus(splstat);
  24.       GotoXY(40,Wherey);
  25.       Write('Bytes left to print : ',splstat.BytesToPrint:6);
  26.     END;
  27.   Writeln;
  28.  
  29.   Close(Spl);            { To change spooler mode, first close it. }
  30.  
  31.       { Check and see if there's an expanded memory manager loaded, and that
  32.          there's enough memory available for the spooler. }
  33.  
  34.   IF Spool_In_EMS(32768) <> 0 THEN
  35.      Writeln( 'EMS spooler not installed.')
  36.   ELSE
  37.     BEGIN
  38.       Rewrite(SPL);
  39.       Writeln('Spooling in EMS. ');
  40.       FOR X := 11 to 20 DO
  41.         BEGIN
  42.           Writeln(SPL,'Spooled in EMS. Hello, Hello, is there anybody out there ? ',X,' Mem Avail ',memavail);
  43.           Writeln(X);
  44.         END;
  45.       Spoolerstatus(splstat);
  46.  
  47.       While splstat.BytesToPrint <> 0 DO
  48.         BEGIN
  49.           Spoolerstatus(splstat);
  50.           GotoXY(40,Wherey);
  51.           Write('Bytes left to print : ',splstat.BytesToPrint:6);
  52.         END;
  53.       Writeln;
  54.       Close(SPL);
  55.     END;
  56.  
  57.   IF Spool_In_XMS(16384) <> 0 THEN
  58.      Writeln( 'XMS spooler not installed.')
  59.   ELSE
  60.     BEGIN
  61.       Rewrite(SPL);
  62.       Writeln('Spooling in XMS. ');
  63.       FOR X := 21 to 30 DO
  64.         BEGIN
  65.           Writeln(SPL,'Spooled in XMS. Hello, Hello, is there anybody out there ? ',X,' Mem Avail ',memavail);
  66.           Writeln(X);
  67.         END;
  68.       Spoolerstatus(splstat);
  69.       While splstat.BytesToPrint <> 0 DO
  70.         BEGIN
  71.           Spoolerstatus(splstat);
  72.           GotoXY(40,Wherey);
  73.           Write('Bytes left to print : ',splstat.BytesToPrint:6);
  74.         END;
  75.       Writeln;
  76.       Close(SPL);
  77.     END;
  78.  
  79.  
  80.   Direct_To_Printer;           { Send output direct to the printer. }
  81.   Rewrite(SPL);
  82.   FOR X := 31 to 40 DO
  83.     BEGIN
  84.       Writeln(SPL,'Direct to printer. Is there anybody out there ? ',X,' Mem Avail ',memavail);
  85.       Writeln(X);
  86.     END;
  87.   Writeln('Finished.');
  88. END.